import React, { Component } from 'react'

export default class Detail extends Component {
  state={
    detailData:[
      {id:0,content:"你好，中国"},
      {id:1,content:"你好，世界"},
      {id:2,content:"你好，未来的自己"}
    ]
  }
  render() {
    //接收参数
    console.log(this.props)
    const {id,title} =this.props.match.params
    const {detailData} =this.state
    const res=detailData.find(e=>{
      return e.id==id
    })
    return (
      <ul>
        <li>ID:{id}</li>
        <li>TITLE:{title}</li>
        <li>CONTENT:{res.content}</li>
      </ul>
    )
  }
}
